package edu.uw.tcss360.group6.model;

/**
 * Project: cd1 phase
 * Group 6- Ambi Adla
 * Author: Bill Minter
 * Author: David Sharer
 * Date: 2/20/13
 */
@SuppressWarnings("serial")
public class Entry implements java.io.Serializable {

    private String my_ID;
    private Contestant my_contestant;
	private Category my_category;
	private WeavingDraft my_weaving_draft;

    //TODO: Not sure this is how we should represent this data - David

	
	private String my_description;

	public Entry(WeavingDraft the_weaving_panel, Category category, String description,
                 Contestant contestant) {
		my_weaving_draft  = the_weaving_panel;
        my_ID = contestant.getUsername() + "_" + category.getName() + "_" + description.substring(0,Math.min(5,description.length()));
		my_category = category;
		my_description = description;
        my_contestant = contestant;
	}
	public WeavingDraft getWeavingDraft()
	{
		return my_weaving_draft;
	}
	public void setWeavingDraft(WeavingDraft the_draft)
	{
		my_weaving_draft = the_draft;
	}

    public Category getCategory() {
        return my_category;
    }

    public String getID() {
        return my_ID;
    }

    public Contestant getContestant() {
        return my_contestant;
    }
   
    public String getDescription()
    {
    	return my_description;
    }
  

    public String toString() {
        return "Name: " + getContestant().getName() + ", Category: "+ my_category.getName();
        		
    }
}
